//
//  LRComposeBtn.swift
//  WeiboX
//
//  Created by admin on 10/12/2016.
//  Copyright © 2016 iOS_Objective-C. All rights reserved.
//

import UIKit

class LRComposeBtn: UIButton {
	
	override var isHighlighted: Bool {
		get {
			return false
		} set {
			// 空实现
		}
	}

	override init(frame: CGRect) {
		super.init(frame: frame)
		
		imageView?.contentMode = .center
		titleLabel?.textAlignment = .center
		setTitleColor(.darkGray, for: .normal)
		titleLabel?.font = .systemFont(ofSize: 14)
	}
	
	required init?(coder aDecoder: NSCoder) {
		fatalError("init(coder:) has not been implemented")
	}

	override func layoutSubviews() {
		super.layoutSubviews()
		// 大小
		imageView?.width = width
		imageView?.height = width
		// y 轴
		imageView?.y = 0
		// 文字 label 大小
		titleLabel?.width = width
		titleLabel?.height = width - height
		// lable zobn
		titleLabel?.x = 0
		titleLabel?.y = width
	}
}
